/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
/*
 * Copyright (c) 2003-2010 Pixware. 
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 */

@namespace "http://www.w3.org/1999/xhtml";
@namespace html "http://www.w3.org/1999/xhtml";
@namespace concordion "http://www.concordion.org/2007/concordion";
@namespace isis "http://isis.apache.org/2010/concordion";

@import "xhtml_table.imp";
@import "xhtml_form.imp";

/* ---------------------------------------------------------------------------
   Concordion/Isis customization
--------------------------------------------------------------------------- */

*[concordion|set] {
    background-color: #99CCCC;
}
*[concordion|execute] {
    background-color: #CCFFCC;
}
*[isis|execute] {
    background-color: #CCFFCC;
}
*[concordion|assertEquals] {
    background-color: #66FF66;
}
*[concordion|assertTrue] {
    background-color: #66FF66;
}
*[concordion|assertFalse] {
    background-color: #66FF66;
}
*[concordion|verifyRows] {
    background-color: #99FF99;
}
*[concordion|run] {
    background-color: #FFFF66;
}


html {
    display: block;
}

/* ---------------------------------------------------------------------------
   Head
--------------------------------------------------------------------------- */

head {
    display: block;
    margin: 1.33ex 0;
    border: 1px solid #CCFAFF;
    background-color: #EEFAFF;
    padding: 0.5em;
    border-radius: 0.5em;
}

title { 
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 2em;
    color: #206080;
    margin-top: .67ex;
    margin-bottom: .67ex;
}

base,
meta,
link,
style,
script,
noscript {
    display: tree;
}

/* ---------------------------------------------------------------------------
   Body
--------------------------------------------------------------------------- */

body {
    display: block;
}

/*
 * Partial support for the Transitional DTD.
 */
body[bgcolor] {
    background-color: concatenate(attr(bgcolor));
}
body[text] {
    color: concatenate(attr(text));
}

/* ---------------------------------------------------------------------------
   Blocks
--------------------------------------------------------------------------- */

div {
    display: block;
}

/*
 * Partial support for the Transitional DTD.
 */
center {
    display: block;
}
div[align=center],
center { 
    margin-left: auto;
    margin-right: auto;
    text-align: center; 
}
div[align=right] { 
    margin-left: auto;
    margin-right: 0;
    text-align: right; 
}

hr {
    display: block;
    content: icon(invisible) icon(invisible);
    border: 2 inset gray;
}

/*
 * Partial support for the Transitional DTD.
 */
hr[noshade] {
    background-color: gray;
    border-style: solid;
}

/* -------------------------------------
   Headings
------------------------------------- */

h1, 
h2, 
h3, 
h4, 
h5,
h6 {
    display: block;
    font-weight: bold;
    color: #206080;
}

h1 { 
    font-size: 1.5em;
    margin-top: .83ex;
    margin-bottom: .83ex;
}

h2 { 
    font-size: 1.3em;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

h3, 
h4, 
h5, 
h6 { 
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

/*
 * Partial support for the Transitional DTD.
 */
h1[align], 
h2[align], 
h3[align], 
h4[align], 
h5[align],
h6[align] {
    text-align: concatenate(attr(align)); 
}

/* -------------------------------------
   Paragraphs
------------------------------------- */

address {
    display: block;
    font-style: italic; 
    margin-top: 1.33ex 0;
}

p { 
    display: block;
    margin: 1.33ex 0;
}

/*
 * Partial support for the Transitional DTD.
 */
p[align] {
    text-align: concatenate(attr(align)); 
}

pre { 
    display: block;
    white-space: pre;
    font-family: monospace;
    background-color: #EEEEEE;
    border: thin solid gray;
    padding: 2px;
    margin: 1.33ex 0;
}

blockquote {
    display: block;
    margin: 1.33ex 10ex;
}

/* -------------------------------------
   Lists
------------------------------------- */

ul { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

li {
    display: block;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

/*
 * Partial support for the Transitional DTD.
 */
ul[compact] > li,
ol[compact] > li {
    margin-top: 0;
    margin-bottom: 0;
}

ul > li {
    margin-left: 2.5ex;
}
ul > li:before {
    display: marker;
    content: disc;
}
ul > li ul > li:before {
    content: square;
}
ul > li ul > li ul > li:before {
    content: icon(diamond);
}
ul > li ul > li ul > li ul > li:before {
    content: circle;
}

/*
 * Partial support for the Transitional DTD.
 */
dir,
menu { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}
dir > li,
menu > li {
    margin-left: 2.5ex;
}
dir > li:before {
    display: marker;
    content: icon(right-half-disc);
    color: #206080;
}
menu > li:before {
    display: marker;
    content: icon(right);
    color: #206080;
}

ol { 
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

ol > li {
    margin-left: 6ex;
}
ol > li:before {
    display: marker;
    content: simple-counter(n, decimal) ".";
    font-weight: bold;
}

/* Example of value for style attribute: "list-style-type: lower-roman;" */
ol[style*=lower-alpha] > li:before {
    content: simple-counter(n, lower-alpha) ".";
}
ol[style*=upper-alpha] > li:before {
    content: simple-counter(n, upper-alpha) ".";
}
ol[style*=lower-roman] > li:before {
    content: simple-counter(n, lower-roman) ".";
}
ol[style*=upper-roman] > li:before {
    content: simple-counter(n, upper-roman) ".";
}

/*
 * Partial support for the Transitional DTD.
 */
ol[type=a] > li:before {
    content: simple-counter(n, lower-alpha) ".";
}
ol[type=A] > li:before {
    content: simple-counter(n, upper-alpha) ".";
}
ol[type=i] > li:before {
    content: simple-counter(n, lower-roman) ".";
}
ol[type=I] > li:before {
    content: simple-counter(n, upper-roman) ".";
}

ol ul, ul ol, ul ul, ol ol { 
    margin-top: 0; 
    margin-bottom: 0; 
}

dl {
    display: block;
    margin-left: 2ex;
    margin-top: 1.33ex;
    margin-bottom: 1.33ex;
}

dt {
    display: block;
    font-weight: bold; 
}

dd { 
    display: block;
    margin-left: 4ex;
    margin-bottom: 1.33ex;
}

/*
 * Partial support for the Transitional DTD.
 */
dl[compact] > dd {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Inlines

   span
   em strong cite dfn code samp kbd var abbr acronym
   q
   sub sup
   br
   tt i b 
   big small
   basefont font
   strike s u
   a
--------------------------------------------------------------------------- */

b, 
strong { 
    font-weight: bold; 
}

i, 
em, 
cite,
var { 
    font-style: italic; 
}

q:before {
    content: open-quote;
    font-weight: bold;
    color: gray;
}
q:after {
    content: close-quote;
    font-weight: bold;
    color: gray;
}

tt, 
kbd, 
code, 
samp,
var { 
    font-family: monospace;
}

abbr, 
acronym { 
    font-weight: bold;
}

dfn {
    background-color: #FFFFE0;
}

/*
 * Clearly show that a span which has a class attribute is something special.
 */
span[class]:before {
    content: icon(left-half-disc);
    color: #C0C040;
}
span[class]:after {
    content: icon(right-half-disc);
    color: #C0C040;
}

sub, 
sup {
    display: inline-block;
    white-space: nowrap;
    font-size: small;
}
sub { 
    vertical-align: sub;
}
sup { 
    vertical-align: super;
}

/*
 * Partial support for the Transitional DTD.
 */
strike,
s {
    text-decoration: line-through;
}
u { 
    text-decoration: underline;
}

br:before { 
    content: "\A"; 
    color: gray;
}

big { 
    font-size: large;
}
small { 
    font-size: small;
}

/*
 * Partial support for the Transitional DTD.
 */
basefont { 
    content: "basefont=" attr(size);
    font-size: small;
    color: gray;
}
font[color] {
    color: concatenate(attr(color));
}
font[face] {
    font-family: concatenate(attr(face));
}
font[size="1"] {
    font-size: x-small;
}
font[size="2"] {
    font-size: small;
}
font[size="3"] {
    font-size: medium;
}
font[size="4"] {
    font-size: large;
}
font[size="5"] {
    font-size: x-large;
}
font[size="6"],
font[size="7"] {
    font-size: xx-large;
}
font[size="-3"] {
    font-size: smaller;
}
font[size="-2"] {
    font-size: smaller;
}
font[size="-1"] {
    font-size: smaller;
}
font[size="+1"] {
    font-size: larger;
}
font[size="+2"] {
    font-size: larger;
}
font[size="+3"] {
    font-size: larger;
}

a[href] { 
    color: navy;
    text-decoration: underline;
}
a[name]:after,
a[id]:after { 
    content: icon(right-target); 
    color: gray;
    vertical-align: text-top;
}

a[href][class="drop_site"]:after {
    content: " " drop-site(icon, icon(drop),
                           command, "setImage", 
                           parameter, "href anyURI - '%{value}'");
    vertical-align: text-top;
}

/* ---------------------------------------------------------------------------
   Ins/del
  
   When this is really needed, put the ins/del into a span 
   to force inline display.
--------------------------------------------------------------------------- */

ins {
    display: block;
    border-width: 2px;
    border-style: solid;
    border-color: transparent blue transparent transparent;
    padding-right: 5px;
}

p ins,
pre ins,
h1 ins, h2 ins, h3 ins, h4 ins, h5 ins, h6 ins,
dt ins, 
address ins,
a ins,
span ins,
bdo ins,
em ins, strong ins,
dfn ins,
code ins,
samp ins,
kbd ins,
var ins,
cite ins,
abbr ins, acronym ins,
q ins,
sub ins, sup ins,
tt ins, i ins, b ins,
big ins, small ins {
    display: inline;
    text-decoration: underline;
}

del {
    display: block;
    color: gray;
    border-width: 2px;
    border-style: solid;
    border-color: transparent gray transparent transparent;
    padding-right: 5px;
}

p del,
pre del,
h1 del, h2 del, h3 del, h4 del, h5 del, h6 del,
dt del, 
address del,
a del,
span del,
bdo del,
em del, strong del,
dfn del,
code del,
samp del,
kbd del,
var del,
cite del,
abbr del, acronym del,
q del,
sub del, sup del,
tt del, i del, b del,
big del, small del {
    display: inline;
    text-decoration: line-through;
}

/* ---------------------------------------------------------------------------
   Objects
--------------------------------------------------------------------------- */

img {
    display: inline;
    content: image-viewport(attribute, src,
			    data-type, anyURI,
	                    content-width, attr(width),
                            content-height, attr(height));
}

/*
 * Partial support for the Transitional DTD.
 */
img[align=bottom],
img[align=middle],
img[align=top] {
    vertical-align: concatenate(attr(align));
}

object,
applet,
param {
    display: tree;
}

map,
area {
    display: tree;
}

/* ---------------------------------------------------------------------------
   When printing
--------------------------------------------------------------------------- */

@media print {
    * {
	background-color: transparent;
        line-height: 1.2;
    }

    base,
    meta,
    link,
    style,
    script,
    noscript {
	display: none;
    }

    meta[name=author][content],
    meta[name=date][content] { 
        display: block;
	text-align: center;
	/* 
	 * Without paragraph(), a static text label is used 
         * and words are not wrapped.
	 */	
        content: paragraph(attr(content));
    }
}
